import { FileItem, PageFileParam } from './model/fileModel'
import { defHttp } from '/@/utils/http/axios'
import { PageResult } from '../model/baseModel'

enum Api {
  PageFile = '/sysFile/page',
  DeleteFile = '/sysFile/delete',
}

export const pageFile = (param: PageFileParam) => {
  return defHttp.get<PageResult<FileItem>>(
    { url: Api.PageFile, params: param },
    { urlPrefix: '/file' },
  )
}

export const deleteFile = (id: number) => {
  return defHttp.post<null>({ url: Api.DeleteFile, params: { id: id } }, { urlPrefix: '/file' })
}
